﻿<%@ Page Title="调整字体" %>
<script language="C#" runat="server">
    void ChangeFontSize(object sender, EventArgs e)
    {
        Profile.FontSize = int.Parse((sender as RadioButtonList).SelectedValue);
    }
    void FontSizeSelector_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            (sender as RadioButtonList).SelectedValue = Profile.FontSize.ToString();
        }
    }
    void ChangeFontFamily(object sender, EventArgs e)
    {
        Profile.FontFamily = ((sender as RadioButtonList).SelectedValue);
    }
    void FontFamilySelector_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            (sender as RadioButtonList).SelectedValue = Profile.FontFamily.ToString();
        }
    }
</script>
<asp:Content ContentPlaceHolderID="b" runat="Server">
    <asp:UpdatePanel runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="size" />
            <asp:PostBackTrigger ControlID="family" />
        </Triggers>
        <ContentTemplate>
            <asp:Panel runat="server" GroupingText="请选择字体尺寸">
                <asp:RadioButtonList runat="server" AutoPostBack="True" OnLoad="FontSizeSelector_Load" OnSelectedIndexChanged="ChangeFontSize" ID="size">
                    <asp:ListItem Value="7" Style="font-size: x-large">大（文字最易于阅读和易于触控操作）</asp:ListItem>
                    <asp:ListItem Value="5" Style="font-size: medium">默认</asp:ListItem>
                    <asp:ListItem Value="3" Style="font-size: small">小</asp:ListItem>
                    <asp:ListItem Value="1" Style="font-size: 10.5px">极小（屏幕内呈现最多账目和其它内容）</asp:ListItem>
                </asp:RadioButtonList>
            </asp:Panel>
            <asp:Panel runat="server" GroupingText="字体">
                <asp:RadioButtonList runat="server" AutoPostBack="True" OnLoad="FontFamilySelector_Load" OnSelectedIndexChanged="ChangeFontFamily" ID="family">
                    <asp:ListItem Value="Microsoft YaHei" Style="font-family: Microsoft YaHei">微软雅黑（更美观）</asp:ListItem>
                    <asp:ListItem Value="Consolas, Microsoft YaHei" Style="font-family: Consolas, Microsoft YaHei">Consolas（账目更清晰）</asp:ListItem>
                    <asp:ListItem Value="FangSong_GB2312" Style="font-family: FangSong_GB2312">仿宋（大字显示更锐利）</asp:ListItem>
                    <asp:ListItem Value="">默认（与您的默认字体一致）</asp:ListItem>
                </asp:RadioButtonList>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <h4>
        说明</h4>
    <ul>
        <li>选择字体需要您的系统中已经装有该字体。</li></ul>
</asp:Content>
